home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 6 / coreaids.zip / CLOSE.ASM < prev    next >
Assembly Source File  |  1987-06-25  |  693b  |  35 lines

  1. ;    DESC:    Closes a file handle                                 V1.00
  2. ;    IN:    *{INHNDL} handle of file to be closed
  3. ;    SAMPLE:    Callm    CLOSE,<INHNDL>,
  4. ;    ##################################################################
  5.  
  6.     Extrn    PUSHALL:Near
  7.     Extrn    POPALL:Near
  8.     Extrn    ERRORMSG:Near
  9.  
  10. CLOSEC    Segment
  11.     Assume    CS:CLOSEC
  12.     Public    CLOSE
  13.  
  14.                         ;notice.
  15.     DB    'CLOSE    - V1.00, Copyright 1987, CoreTechs   ',0DH,0AH
  16.  
  17. CLOSE    Proc    Near                ;closes a file.
  18.     Call    PUSHALL
  19.  
  20.     Pop    BX                ;get the handle.
  21.  
  22.     Mov    AH,3EH                ;close a file.
  23.     Int    21H
  24.     Jc    ERROR                ;if error report it.
  25.  
  26.     Call    POPALL
  27.     Ret
  28.  
  29. ERROR:    Push    AX                ;report error and abort.
  30.     Call    ERRORMSG
  31.  
  32. CLOSE    Endp
  33. CLOSEC    Ends
  34.     End
  35.